import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        int count = 0;
        Scanner scanner = new Scanner(System.in);
        while(true){
            int num = scanner.nextInt();
            if(num > 0){
                count++;
            }else{
                break;
            }
        }
        System.out.println(count);
    }
}